<?php
require_once('../../controller/auth.php');
//Start session
	@session_start();
	
	//Include database connection details
	require_once('../inc/config.inc');
	
	
	
	//Connect to mysql server
	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
	if(!$link) {
		die('Failed to connect to server: ' . mysql_error());
	}
	
	//Select database
	$db = mysql_select_db(DB_DATABASE);
	if(!$db) {
		die("Unable to select database");
	}
	$sn=$_POST['sn3'];
	$stat = $_POST['stat3'];
	$bud_sub_moe=$_POST['bsm'];
	$bud_est_moe=$_POST['bem'];
	$bud_alo_moe=$_POST['bam'];
	echo $bud_alo_moe;
mysql_query ('SET NAMES utf8');
mysql_query('SET CHARACTER_SET utf8');
$insert=mysql_query("UPDATE main SET submission_moe_finance_date='$bud_sub_moe', est_day_moe_fn='$bud_est_moe',received_moe_finace_date='$bud_sub_moe', status='2' WHERE serial='$sn'") or die ("Error occured : ".mysql_error());
if($insert){
	
	
	?>
	<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">Thank you,</h3>
	  </div>
	  <div class="modal-body">
	    <p class="text-success lead">Your Project has been Updated Successfully!</p>
	  </div>
	  <div class="modal-footer">
	    <button class="btn btn-large btn-warning btn-block" data-dismiss="modal" aria-hidden="true">OK</button>
	    
	  </div>
	</div>
	
	<?php
	}
	else {
	?>
	<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">OOops!</h3>
	  </div>
	  <div class="modal-body">
	    <p class="text-error lead">Your Project has not been Updated Successfully!</p>
	  </div>
	  <div class="modal-footer">
	    <button class="btn btn-large btn-danger btn-block" data-dismiss="modal" aria-hidden="true">Shut Up!</button>
	    
	  </div>
	</div>
	<?php
		
		}
		?>